The variable 'local.player' was never assigned an entity or anything, so it is NIL by default.
In a multiplayer context $player is not an entity, rather $player is an array of entities.
It will, however, stay NULL, as long as no players have entered the game.
If all players leave the round/level, it'll still be an array, but it'll have a size of 0.
So it should look more like:
Code:
main:
while !($player)
wait 1
while(1) {
for (local.i = 1; local.i <= $player.size; local.i++) {
if ($player[local.i].nolean == NIL) {
thread nolean $player[local.i]
}
}
}
end
nolean local.player:
local.player.nolean = 1
while (local.player) {
local.position = local.player getposition
if (local.position == "crouching") {
println "im crouching"
local.player stufftext "+leanleft;+leanright"
wait 0.3
}
else {
waitframe
}
}
end
I'm not sure what you're trying to do, though. At the moment, anyone who crouches even once will have their leaning disabled.